package pluginUtils;

import java.util.ArrayList; 
import java.util.Iterator;
import java.util.Random;




/** A Circle Packing Algorithm Collins,Stephenson
 * 
 * @author decomite
 *
 */

public class CircleArrangement {
	private ArrayList<PackCircle> circleList=new ArrayList<PackCircle>(); 
	private ArrayList<PackCircle> dessines=new ArrayList<PackCircle>();
	private static Random generator=new Random();
	
	/** Initialize a graph with  pentagonal shape
	 * to be generalized to :
	 * <ul> 
	 * <li> Any regular polygon</li>
	 * <li> Any number of internal levels</li>
	 *  </ul>
	 */
	
public void initPentagon(){
	int side=27; 
	int level=12;
	double a=0.5; 
	double b=1.2; 
	double rap[]={a,b,a/b,b/a,1/(a*a),1/b};
	// external circles
	for(int i=0;i<side;i++) {PackCircle nv=new PackCircle(4,false,1,1);}
	// first level circles
	for(int i=0;i<side;i++){PackCircle nv=new PackCircle(6,true,1,0); }
	// Internal circles
	for(int l=2;l<level-1;l++){
		for(int i=0;i<side;i++){PackCircle nv=new PackCircle(6,true,1,0);}
	}
	// When level=level-1
		for(int i=0;i<side;i++){
			PackCircle nv=new PackCircle(5,true,1,0); 
		}
	// central circle
	PackCircle nv=new PackCircle(side,true,1,0); 
	
	// define the neighbourhood
	// external circles
	for(int i=0;i<side;i++){
		int lev=0;
		int ord=i; 
		PackCircle c=PackCircle.getCircleAt(i);
		c.setNeighbourAt(0, PackCircle.getCircleAt((i+1)%side));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side+i));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side+(side+i-1)%side));
		c.setNeighbourAt(3, PackCircle.getCircleAt((side+i-1)%side));
	}
	// level one circles
	for(int i=side;i<2*side;i++){
		int lev=i/side;
		int ord=i%side; 
		PackCircle c=PackCircle.getCircleAt(i);
		c.setNeighbourAt(0, PackCircle.getCircleAt(side*(lev-1)+ord));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side*(lev-1)+(ord+1)%side));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side*(lev)+(ord+1)%side));
		c.setNeighbourAt(3, PackCircle.getCircleAt(side*(lev+1)+(ord+1)%side));
		c.setNeighbourAt(4, PackCircle.getCircleAt(side*(lev+1)+ord));
		c.setNeighbourAt(5, PackCircle.getCircleAt(side*(lev)+(ord+side-1)%side));
	}
	
	// internal circles // except last level......
	
	for(int i=2*side;i<(level-1)*side;i++){
		int lev=i/side;
		int ord=i%side; 
		PackCircle c=PackCircle.getCircleAt(i);
		c.setNeighbourAt(0, PackCircle.getCircleAt(side*(lev-1)+ord));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side*(lev)+(ord+1)%side));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side*(lev+1)+ord));
		c.setNeighbourAt(3, PackCircle.getCircleAt(side*(lev+1)+(ord+side-1)%side));
		c.setNeighbourAt(4, PackCircle.getCircleAt(side*(lev)+(ord+side-1)%side));
		c.setNeighbourAt(5, PackCircle.getCircleAt(side*(lev-1)+(ord+side-1)%side));
	}
	
	// last ring circles
	for(int i=0;i<side;i++){
		PackCircle c=PackCircle.getCircleAt(i+side*(level-1));
		c.setNeighbourAt(0, PackCircle.getCircleAt(side*(level-2)+i));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side*(level-2)+(i+1)%side));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side*(level-1)+(i+1)%side));
		c.setNeighbourAt(3, PackCircle.getCircleAt(PackCircle.size()-1));
		c.setNeighbourAt(4, PackCircle.getCircleAt(side*(level-1)+(i+side-1)%side));
		
	}
	
	// central circle
	PackCircle end=PackCircle.getCircleAt(PackCircle.size()-1); 
	for(int i=0;i<side;i++){
		end.setNeighbourAt(i, PackCircle.getCircleAt(PackCircle.size()-side+i-1)); 
	}
	
	for(int i=0;i<PackCircle.size();i++)
		this.circleList.add(PackCircle.getCircleAt(i));
}
	

public void initPentagonWithRandom(){
	int side=27; 
	int level=12;
	double a=0.5; 
	double b=1.2; 
	double rap[]={a,b,a/b,b/a,1/(a*a),1/b};
	int cpt=0;
	// external circles
	for(int i=0;i<side;i++) {PackCircle nv=new PackCircle(4,false,1,1);}
	// first level circles
	for(int i=0;i<side;i++){
		boolean bb=(generator.nextDouble()>0.1); 
		PackCircle nv=new PackCircle(6,(bb&&(cpt++<1)),1,0); 
		}
	// Internal circles
	for(int l=2;l<level-1;l++){
		for(int i=0;i<side;i++){
			boolean bb=(generator.nextDouble()>0.1); 
			PackCircle nv=new PackCircle(6,(bb&(cpt++<1)),1,0);}
	}
	// When level=level-1
		for(int i=0;i<side;i++){
			PackCircle nv=new PackCircle(5,true,1,0); 
		}
	// central circle
	PackCircle nv=new PackCircle(side,true,1,0); 
	
	// define the neighbourhood
	// external circles
	for(int i=0;i<side;i++){
		int lev=0;
		int ord=i; 
		PackCircle c=PackCircle.getCircleAt(i);
		c.setNeighbourAt(0, PackCircle.getCircleAt((i+1)%side));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side+i));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side+(side+i-1)%side));
		c.setNeighbourAt(3, PackCircle.getCircleAt((side+i-1)%side));
	}
	// level one circles
	for(int i=side;i<2*side;i++){
		int lev=i/side;
		int ord=i%side; 
		PackCircle c=PackCircle.getCircleAt(i);
		c.setNeighbourAt(0, PackCircle.getCircleAt(side*(lev-1)+ord));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side*(lev-1)+(ord+1)%side));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side*(lev)+(ord+1)%side));
		c.setNeighbourAt(3, PackCircle.getCircleAt(side*(lev+1)+(ord+1)%side));
		c.setNeighbourAt(4, PackCircle.getCircleAt(side*(lev+1)+ord));
		c.setNeighbourAt(5, PackCircle.getCircleAt(side*(lev)+(ord+side-1)%side));
	}
	
	// internal circles // except last level......
	
	for(int i=2*side;i<(level-1)*side;i++){
		int lev=i/side;
		int ord=i%side; 
		PackCircle c=PackCircle.getCircleAt(i);
		c.setNeighbourAt(0, PackCircle.getCircleAt(side*(lev-1)+ord));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side*(lev)+(ord+1)%side));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side*(lev+1)+ord));
		c.setNeighbourAt(3, PackCircle.getCircleAt(side*(lev+1)+(ord+side-1)%side));
		c.setNeighbourAt(4, PackCircle.getCircleAt(side*(lev)+(ord+side-1)%side));
		c.setNeighbourAt(5, PackCircle.getCircleAt(side*(lev-1)+(ord+side-1)%side));
	}
	
	// last ring circles
	for(int i=0;i<side;i++){
		PackCircle c=PackCircle.getCircleAt(i+side*(level-1));
		c.setNeighbourAt(0, PackCircle.getCircleAt(side*(level-2)+i));
		c.setNeighbourAt(1, PackCircle.getCircleAt(side*(level-2)+(i+1)%side));
		c.setNeighbourAt(2, PackCircle.getCircleAt(side*(level-1)+(i+1)%side));
		c.setNeighbourAt(3, PackCircle.getCircleAt(PackCircle.size()-1));
		c.setNeighbourAt(4, PackCircle.getCircleAt(side*(level-1)+(i+side-1)%side));
		
	}
	
	// central circle
	PackCircle end=PackCircle.getCircleAt(PackCircle.size()-1); 
	for(int i=0;i<side;i++){
		end.setNeighbourAt(i, PackCircle.getCircleAt(PackCircle.size()-side+i-1)); 
	}
	
	for(int i=0;i<PackCircle.size();i++)
		this.circleList.add(PackCircle.getCircleAt(i));
}
	
	/** Enter the circles and their neighbours : might be tedious
	 * as we must declare which circles are the neighbours of a particular circle, 
	 * relation must be transitive, and we must precise the order in which the neighbours circles surround
	 * a particular circle...
	 */
	public void init(int size){
		 
		PackCircle chessBoard[][]=new PackCircle[size][size];
		
		// External circles
		
		
		// colonnes externes
		for(int j=1;j<size-1;j++){
			chessBoard[j][0]=new PackCircle(4,false,0.5,j);
			chessBoard[j][size-1]=new PackCircle(4,false,0.1,j);
		}
		
		// lignes externes
		for(int j=1;j<size-1;j++){
			if(j%2==0){
				chessBoard[0][j]=new PackCircle(3,false,0.2,j);
				chessBoard[size-1][j]=new PackCircle(5,false,0.5,j);
			}
			else{
				chessBoard[0][j]=new PackCircle(5,false,0.2,j);
				chessBoard[size-1][j]=new PackCircle(3,false,0.5,j);
			}
		}
		// DONE pour les coins
		
		chessBoard[0][0]=new PackCircle(2,false,1,0); 
		chessBoard[size-1][0]=new PackCircle(3,false,1,0);
		
		chessBoard[size-1][size-1]=new PackCircle(2+(size%2),false,1,size-1);
		chessBoard[0][size-1]=new PackCircle(3-(size%2),false,1,size-1); 
		
		// Internal circles
		for(int i=1;i<size-1;i++)
			for(int j=1;j<size-1;j++)
				chessBoard[i][j]=new PackCircle(6,true,1,i);
				
		// defining the neighbours
		// Internal circle : six neighbours
		
		for(int i=1;i<size-1;i++){
			
			for(int j=1;j<size-1;j++){
				if(j%2==0){
				chessBoard[i][j].setNeighbourAt(2, chessBoard[i][j+1]); 
				chessBoard[i][j].setNeighbourAt(3, chessBoard[i+1][j]); 
				chessBoard[i][j].setNeighbourAt(4, chessBoard[i][j-1]); 
				chessBoard[i][j].setNeighbourAt(0, chessBoard[i-1][j]); 
				chessBoard[i][j].setNeighbourAt(5, chessBoard[i-1][j-1]); 
				chessBoard[i][j].setNeighbourAt(1, chessBoard[i-1][j+1]);
				}
				else{
					chessBoard[i][j].setNeighbourAt(1, chessBoard[i][j+1]); 
					chessBoard[i][j].setNeighbourAt(3, chessBoard[i+1][j]); 
					chessBoard[i][j].setNeighbourAt(5, chessBoard[i][j-1]); 
					chessBoard[i][j].setNeighbourAt(0, chessBoard[i-1][j]); 
					chessBoard[i][j].setNeighbourAt(4, chessBoard[i+1][j-1]); 
					chessBoard[i][j].setNeighbourAt(2, chessBoard[i+1][j+1]);
				}
			}
		}
		
		//The four corners
		
		
			chessBoard[0][0].setNeighbourAt(0,chessBoard[0][1]);
			chessBoard[0][0].setNeighbourAt(1,chessBoard[1][0]);
		
			chessBoard[size-1][0].setNeighbourAt(0,chessBoard[size-2][0]);
			chessBoard[size-1][0].setNeighbourAt(1,chessBoard[size-2][1]);
			chessBoard[size-1][0].setNeighbourAt(2,chessBoard[size-1][1]);
		
			if(size%2==1){
				chessBoard[0][size-1].setNeighbourAt(0,chessBoard[1][size-1]);
				chessBoard[0][size-1].setNeighbourAt(1,chessBoard[0][size-2]);
				
				
				chessBoard[size-1][size-1].setNeighbourAt(0,chessBoard[size-1][size-2]);
				chessBoard[size-1][size-1].setNeighbourAt(1,chessBoard[size-2][size-2]);
				chessBoard[size-1][size-1].setNeighbourAt(2,chessBoard[size-2][size-1]);
			}
			else{
				chessBoard[0][size-1].setNeighbourAt(0,chessBoard[1][size-1]);
				chessBoard[0][size-1].setNeighbourAt(1,chessBoard[1][size-2]);
				chessBoard[0][size-1].setNeighbourAt(2,chessBoard[0][size-2]);
				
				
				chessBoard[size-1][size-1].setNeighbourAt(0,chessBoard[size-1][size-2]);
				chessBoard[size-1][size-1].setNeighbourAt(1,chessBoard[size-2][size-1]);
			}
				
		// todo il manque les cotes (verticaux et horizontaux).......	
			for(int j=1;j<size-1;j++){
				// colonne de gauche
				chessBoard[j][0].setNeighbourAt(0,chessBoard[j-1][0]); 
				chessBoard[j][0].setNeighbourAt(1,chessBoard[j-1][1]); 
				chessBoard[j][0].setNeighbourAt(2,chessBoard[j][1]); 
				chessBoard[j][0].setNeighbourAt(3,chessBoard[j+1][0]); 
				
				// colonne de droite
				int dc=0;
				if(size%2==0) dc=1; else dc=0; 
				chessBoard[j][size-1].setNeighbourAt(0,chessBoard[j+1][size-1]); 
				chessBoard[j][size-1].setNeighbourAt(1,chessBoard[j+dc][size-2]); 
				chessBoard[j][size-1].setNeighbourAt(2,chessBoard[j-1+dc][size-2]); 
				chessBoard[j][size-1].setNeighbourAt(3,chessBoard[j-1][size-1]);
				
				// ligne du haut
				if(j%2==1){
					chessBoard[0][j].setNeighbourAt(0,chessBoard[0][j+1]); 
					chessBoard[0][j].setNeighbourAt(1,chessBoard[1][j+1]); 
					chessBoard[0][j].setNeighbourAt(2,chessBoard[1][j]); 
					chessBoard[0][j].setNeighbourAt(3,chessBoard[1][j-1]); 
					chessBoard[0][j].setNeighbourAt(4,chessBoard[0][j-1]); 
				}
				else{
					chessBoard[0][j].setNeighbourAt(0,chessBoard[0][j+1]); 
					chessBoard[0][j].setNeighbourAt(1,chessBoard[1][j]); 
					chessBoard[0][j].setNeighbourAt(2,chessBoard[0][j-1]); 
				}
				
				// ligne du bas
				if(j%2==1){
					chessBoard[size-1][j].setNeighbourAt(0,chessBoard[size-1][j-1]); 
					chessBoard[size-1][j].setNeighbourAt(1,chessBoard[size-2][j]); 
					chessBoard[size-1][j].setNeighbourAt(2,chessBoard[size-1][j+1]); 
				}
				else{
					chessBoard[size-1][j].setNeighbourAt(0,chessBoard[size-1][j-1]); 
					chessBoard[size-1][j].setNeighbourAt(1,chessBoard[size-2][j-1]); 
					chessBoard[size-1][j].setNeighbourAt(2,chessBoard[size-2][j]); 
					chessBoard[size-1][j].setNeighbourAt(3,chessBoard[size-2][j+1]); 
					chessBoard[size-1][j].setNeighbourAt(4,chessBoard[size-1][j+1]); 
				}
			}
			
			
			
		
		// Add all circles to collection
		for(int i=0;i<size;i++)
			for(int j=0;j<size;j++)
				circleList.add(chessBoard[i][j]);
		
		
	}
	
	private void initMinim(){
		PackCircle c1=new PackCircle(3,false,1); 
		PackCircle c2=new PackCircle(3,false,1); 
		PackCircle c3=new PackCircle(3,false,1);
		PackCircle c4=new PackCircle(3,false,1);
		
		PackCircle c5=new PackCircle(4,true,1); 
		PackCircle c6=new PackCircle(4,true,1); 
		
		c1.setNeighbourAt(0, c2); 
		c1.setNeighbourAt(1, c4); 
		c1.setNeighbourAt(2, c5); 
		
		c2.setNeighbourAt(0, c1);
		c2.setNeighbourAt(1, c3); 
		c2.setNeighbourAt(2, c6);
		
		c3.setNeighbourAt(0, c1);
		c3.setNeighbourAt(1, c2); 
		c3.setNeighbourAt(2, c6);
		
		c4.setNeighbourAt(0, c1);
		c4.setNeighbourAt(1, c3); 
		c4.setNeighbourAt(2, c5);
		
		c5.setNeighbourAt(0, c1);
		c5.setNeighbourAt(1, c2); 
		c5.setNeighbourAt(2, c6);
		c5.setNeighbourAt(3, c3);
		
		
		c6.setNeighbourAt(0, c2);
		c6.setNeighbourAt(1, c4); 
		c6.setNeighbourAt(2, c3);
		c6.setNeighbourAt(3, c5);
		
		
		
		this.circleList.add(c1);
		this.circleList.add(c2);
		this.circleList.add(c3);
		this.circleList.add(c4);
		this.circleList.add(c5);
		this.circleList.add(c6);
		
		
	}
	
	/** Adjust radii in order to reduce overlapping (key algorithm)
	 * 
	 * @return : quadratic error
	 */
	public double iterer(){
		double error=0; 
		int i=0;
		for(PackCircle c: circleList){
			if(c.isInternal()){
				double th=c.computeTheta();
				error=error+(th-2*Math.PI)*(th-2*Math.PI); 
				int k=c.getNbNeighbours(); 
				double beta=Math.sin(th/(2*k)); 
				double gamma=Math.sin(Math.PI/k);
				double vchap=c.getRadius()*beta/(1-beta); 
				double u=vchap*(1-gamma)/gamma; 
				c.setRadius(u);
				
			}
			
		}
		
		return Math.sqrt(error); 
	}
	
	public boolean verify(ArrayList<PackCircle> toto){
		boolean v=true; 
		int i=0;
		System.out.println("verification "+toto.size()); 
		for(PackCircle e:toto){
			 
			System.out.print("\t "+e+" ("+e.getMyOrder()+") voisins : "+e.getNbNeighbours()+":");
			if(e.isInternal())
				System.out.println(" internal "); 
			else
				System.out.println(" external ");
			for(int j=0;j<e.getNbNeighbours();j++){
				System.out.println("\t\t"+j+" : "+e.getNeighbourAt(j).getMyOrder());
			}
			if(e==null){
				v=false; 
				System.out.println("Pb dans la liste : "+(i++)); 
			}
		}
		return v; 
		
	}
	
	// deux voisins consecutifs sont déja dessines
	private boolean isDrawable(PackCircle u){ 
		for(int i=0;i<u.getNbNeighbours()-1;i++)
			if(dessines.contains(u.getNeighbourAt(i))&&(dessines.contains(u.getNeighbourAt(i+1 )))){
				System.out.println("found : "+u.getMyOrder()+" between "+u.getNeighbourAt(i).getMyOrder()+" and "+u.getNeighbourAt(i+1).getMyOrder());
				return true; 
			}
		int fin=u.getNbNeighbours()-1; 
		if((u.isInternal())&&(dessines.contains(u.getNeighbourAt(fin))&&(dessines.contains(u.getNeighbourAt(0 ))))){
			System.out.println("found : "+u.getMyOrder()+" between "+u.getNeighbourAt(fin).getMyOrder()+" and "+u.getNeighbourAt(0).getMyOrder()+" (internal)");

			return true; 
		}
		return false;
		}
	
	/** Compute the position of each circle (center)
	 * 
	 */
	public void computePosition(){
	int tour=0; 	
	
	PackCircle u=null;
	Iterator<PackCircle> cursor=circleList.iterator(); 
	while(cursor.hasNext()){
		u=cursor.next();
		if(u.isInternal()) break; 
	}
	if(u==null){System.out.println("Pas de cercle non nul..."); System.exit(0); }
	u.setX(0.0);
	u.setY(0.0); 
	circleList.remove(u);
	dessines.add(u); 
	System.out.println("Dessiner le cercle x0 "+u); 
	PackCircle v=u.getNeighbourAt(0); 
	v.setX(u.getRadius()+v.getRadius()+u.getX()); 
	v.setY(u.getY()); 
	circleList.remove(v);
	dessines.add(v);
	System.out.println("Dessiner le cercle x1 "+v);
	boolean found=true; 
	while(found){ // sortie quand tous les cercles sont dessines
		found=false; 
		for(int i=0;i<circleList.size();i++){
			u=circleList.get(i); 
			if((!u.isCoordset())&& isDrawable(u)){
				found=true; break; 
			}
		}//for
		
	if(found){	
	// Calculer les coordonnees de u en fonction de celles de ses deux voisins
	// deja traces. 
	// u a deux de ses voisins consecutifs deja dessines. On les recherche
	PackCircle v1=null; 
	PackCircle v2=null; 
	boolean stopIt=false; 
	for(int i=0;i<u.getNbNeighbours()-1;i++){
		if(dessines.contains(u.getNeighbourAt(i))&&(dessines.contains(u.getNeighbourAt(i+1)))){
			v1=u.getNeighbourAt(i); 
			v2=u.getNeighbourAt(i+1);
			stopIt=true; 
		}	
		if(stopIt)break; 
	}
	// Si on n'a pas trouvé, c'est que c'est entre le dernier et le premier
	
	if(v1==null){
		v1=u.getNeighbourAt(u.getNbNeighbours()-1); 
		v2=u.getNeighbourAt(0); 
	}
	System.out.println("On utilise "+v1+" et \n"+v2); 
	double r1=v1.getRadius(); 
	double r2=v2.getRadius(); 
	double r=u.getRadius(); 
	double alpha=(r1+r2)*(r1+r2)+(r+r2)*(r+r2)-(r+r1)*(r+r1);
	alpha=alpha/(2*(r+r2)*(r1+r2)); 
	System.out.println("r1 r2 r "+r1+" "+r2+" "+r);
	alpha=-Math.acos(alpha);
	System.out.println("Angle :"+alpha*180/Math.PI);
	System.out.println("V1 ** "+v1.getX()+" "+v1.getY()+" "+v1.getMyOrder()); 
	System.out.println("V2 ** "+v2.getX()+" "+v2.getY()+" "+v2.getMyOrder()); 
	
	double x1=v2.getX()+(r2+r)/(r1+r2)*(v1.getX()-v2.getX());
	double y1=v2.getY()+(r2+r)/(r1+r2)*(v1.getY()-v2.getY());
	System.out.println("--------->"+x1+" "+y1); 
    u.setX(Math.cos(alpha)*(x1-v2.getX())-Math.sin(alpha)*(y1-v2.getY())+v2.getX());
    u.setY(Math.sin(alpha)*(x1-v2.getX())+Math.cos(alpha)*(y1-v2.getY())+v2.getY());
	boolean recouvert=false; 
	for(PackCircle e:this.dessines){
		if(PackCircle.dist(u,e)<0.9*(u.getRadius()+e.getRadius())){
			System.out.println(u+" et "+e+" se recouvrent");
			recouvert=true; 
		}
	}
	/*
	if(recouvert )
	{	
	alpha=-alpha; 	
	u.setX(Math.cos(alpha)*(x1-v2.getX())-Math.sin(alpha)*(y1-v2.getY())+v2.getX());
    u.setY(Math.sin(alpha)*(x1-v2.getX())+Math.cos(alpha)*(y1-v2.getY())+v2.getY());
		
	}
	*/
	}
	// TODO : double emploi avec coordSet
	//circleList.remove(u);
	dessines.add(u);
	System.out.println("Dessiner le cercle x2 "+u);
	tour++; 
	//if(tour==3) return;
	}
	}	
	

	public static void main(String[] args) {
		CircleArrangement A=new CircleArrangement(); 
		A.init(4); 
		for(int i=0;i<100;i++)
			System.out.println(i+" "+A.iterer());
		A.verify(A.circleList);
		
		A.computePosition(); 
		int i=0;
		
		for(PackCircle u:A.dessines)
			System.out.println((i++)+" "+u.getRadius()+" "+u.getX()+" "+u.getY()+"(cercle numero "+u.getMyOrder()+")");
			 
}

	/**
	 * @return the circleList
	 */
	public ArrayList<PackCircle> getCircleList() {
		return circleList;
	}

	/**
	 * @return the dessines
	 */
	public ArrayList<PackCircle> getDessines() {
		return dessines;
	}
	
}












